Says what bg shows past the edge of its picture: EDGE_REPEAT (the picture again), EDGE_EMPTY (nothing), EDGE_STRETCH (the picture’s outermost row and column of tiles carried outward) or EDGE_COLOR (one solid color, the third argument).
Works differently on Game Boy - The Game Boy decides this when the game is built, from the last choice written in plain words in the room's code: the picture again every 256 pixels, black, its edge tiles carried outward, or one color. Written while playing, it does nothing.
Works differently on Game Boy Color - The Game Boy Color decides this when the game is built, from the last choice written in plain words in the room's code: the picture again every 256 pixels, black, its edge tiles carried outward, or one color. Written while playing, it does nothing.
Sega Genesis: not built yet
On other consoles this differs: see Side by side and How the consoles differ.
background_edge(bg, edge, color = COLOR_BLACK)| Name | Type |
|---|---|
bg | background |
edge | edge |
color | shape_color (can be left out; then it is COLOR_BLACK) |
Nothing.
Says what bg shows past the edge of its picture. A no-op on nothing. The change happens the next time a Draw event draws the background, and it stays until you change it again.
There are four choices:
edge | What shows past the edge |
|---|---|
EDGE_REPEAT | the picture again, as the console does by itself |
EDGE_EMPTY | nothing: the screen's own color |
EDGE_STRETCH | the picture's outermost row and column of tiles, carried outward |
EDGE_COLOR | one solid color: the third argument, one of the eight COLOR_ names (black if you leave it out) |
background_repeat is the short way to say the first two (true and false). EDGE_EMPTY is done the same cheap ways it describes.
A stretched edge is made by building the picture again in memory with a margin of 32 tiles (256 pixels) of its own outermost tiles on every side, and keeping the view inside that margin. So it costs memory (about 32 KB for a picture 512 pixels wide), only one background can be stretched at a time, and the picture can be at most 1024 pixels on a side. If it cannot be done, the background repeats and the development log says why. The edge is one row or column of 8x8 tiles carried outward, so it repeats 8 pixels of the picture's edge, not 1.
One color is the empty edge plus a color: while this background is drawn the screen's own background color is the color you gave, so it also shows through any clear part of any picture and behind everything. The room's own color comes back when the background is not drawn.
backdrop = background_create(0, 0, ts_doc_dungeon);
background_edge(backdrop, EDGE_COLOR, COLOR_BLACK);Makes a background from the dungeon picture and makes everything past its edge solid black.
A no-op on `nothing`. It takes effect the next time a Draw event draws the background. EDGE_EMPTY is the same as background_repeat(bg, false) and is done the same cheap ways (see background_repeat). EDGE_STRETCH rebuilds the picture in memory with a margin of 32 tiles (256 pixels) of its own outermost tiles on every side, and keeps the view inside that margin; only ONE background can be stretched at a time, the picture can be at most 1024 pixels on a side, and it uses memory (about 32 KB for a picture 512 pixels wide) that the game sets aside only if some code asks for EDGE_STRETCH. If it cannot be done the background repeats and the development log says why. A stretched edge is one row or one column of 8x8 tiles carried outward, so it repeats 8 pixels of the picture’s edge, not 1. EDGE_COLOR is EDGE_EMPTY plus the color: the color is the SCREEN’S background color while this background is drawn, so it also shows through any clear part of any picture and behind everything, and the room’s own color comes back when the background is not drawn. Pass one of the eight COLOR_ names.